package com.glela.platform.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.glela.platform.mapper.CPromotionChannelMapper;
import com.glela.platform.model.PromotionChannel;
import com.glela.platform.service.IChannelService;

@Service
public class ChannelService implements IChannelService{

	@Autowired
	CPromotionChannelMapper channelMapper;
	
	@Override
	public PromotionChannel selectByName(String name) {
		
		return channelMapper.selectByName(name);
	}

	@Override
	public PromotionChannel saveChannel(String channelName) {
		PromotionChannel channel = new PromotionChannel();
		channel.setName(channelName);
		channelMapper.insert(channel);
		return channel;
	}

}
